home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / LATEX macros.adf / inputs / ieeetr.bst < prev    next >
Text File  |  1988-02-21  |  13KB  |  732 lines

  1. % IEEE Transactions bibliography style
  2. %    numeric labels, order-of-reference, IEEE abbreviations,
  3. %    quotes around article titles, commas separate all fields
  4. %    except after book titles and before "notes".  Otherwise,
  5. %    much like the "plain" family, from which this is adapted.
  6. %
  7. %   History
  8. %   9/30/85 (HWT) Original version, by Howard Trickey.
  9. ENTRY
  10.   { address
  11.     author
  12.     booktitle
  13.     chapter
  14.     edition
  15.     editor
  16.     howpublished
  17.     institution
  18.     journal
  19.     key
  20.     month
  21.     note
  22.     number
  23.     organization
  24.     pages
  25.     publisher
  26.     school
  27.     series
  28.     title
  29.     type
  30.     volume
  31.     year
  32.   }
  33.   {}
  34.   {label}
  35.  
  36.  
  37.  
  38. INTEGERS { output.state before.all mid.sentence mid.sentenceb
  39.            after.sentence after.block }
  40.  
  41. FUNCTION {init.state.consts}
  42. { 'before.all #0 :=
  43.   'mid.sentence #1 :=
  44.   'mid.sentenceb #2 :=
  45.   'after.sentence #3 :=
  46.   'after.block #4 :=
  47. }
  48.  
  49.  
  50. STRINGS { s t }
  51.  
  52. FUNCTION {output.nonnull}
  53. { 's swap$ :=
  54.   output.state mid.sentence =
  55.     { ", " * write$ }
  56.     { output.state mid.sentenceb =
  57.         { " " * write$ }
  58.         { output.state after.block =
  59.         { add.period$ write$
  60.           newline$
  61.           "\newblock " write$
  62.         }
  63.         { output.state before.all =
  64.             'write$
  65.             { add.period$ " " * write$ }
  66.           if$
  67.         }
  68.           if$
  69.         }
  70.       if$
  71.     }
  72.   if$
  73.   'output.state mid.sentence :=
  74.   s
  75. }
  76.  
  77. FUNCTION {output}
  78. { 's swap$ :=
  79.   s "" =
  80.     'skip$
  81.     { s output.nonnull }
  82.   if$
  83. }
  84.  
  85. FUNCTION {output.check}
  86. { 's swap$ :=
  87.   't swap$ :=
  88.   s "" =
  89.     { "Warning: the " t * " shouldn't be empty in " * cite$ * top$ }
  90.     { s output.nonnull }
  91.   if$
  92. }
  93.  
  94. FUNCTION {output.bibitem}
  95. { newline$
  96.  
  97.   "\bibitem{" write$
  98.  
  99.   cite$ write$
  100.   "}" write$
  101.   newline$
  102.   ""
  103.   'output.state before.all :=
  104. }
  105.  
  106. FUNCTION {blank.sep}
  107. { 'output.state mid.sentenceb :=
  108. }
  109.  
  110. FUNCTION {fin.entry}
  111. { add.period$
  112.   write$
  113.   newline$
  114. }
  115.  
  116. FUNCTION {new.block}
  117. { output.state before.all =
  118.     'skip$
  119.     { 'output.state after.block := }
  120.   if$
  121. }
  122.  
  123.  
  124. FUNCTION {new.sentence}
  125. { output.state after.block =
  126.     'skip$
  127.     { output.state before.all =
  128.     'skip$
  129.     { 'output.state after.sentence := }
  130.       if$
  131.     }
  132.   if$
  133. }
  134.  
  135.  
  136. FUNCTION {not}
  137. {   { #0 }
  138.     { #1 }
  139.   if$
  140. }
  141.  
  142. FUNCTION {and}
  143. {   'skip$
  144.     { pop$ #0 }
  145.   if$
  146. }
  147.  
  148. FUNCTION {or}
  149. {   { pop$ #1 }
  150.     'skip$
  151.   if$
  152. }
  153.  
  154.  
  155. FUNCTION {field.or.null}
  156. { duplicate$
  157.   missing$
  158.     { pop$ "" }
  159.     'skip$
  160.   if$
  161. }
  162.  
  163. FUNCTION {italicize}
  164. { 's swap$ :=
  165.   s "" =
  166.     { "" }
  167.     { "{\it " s * "}" * }
  168.   if$
  169. }
  170.  
  171. INTEGERS { nameptr namesleft numnames }
  172.  
  173. STRINGS {nameresult}
  174.  
  175. FUNCTION {format.names}
  176. { 's swap$ :=
  177.   'nameptr #1 :=
  178.   'nameresult "" :=
  179.   'numnames s num.names$ :=
  180.   'namesleft numnames :=
  181.     { namesleft #0 > }
  182.     {
  183.  
  184.       't s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ :=
  185.  
  186.       nameptr #1 >
  187.     { namesleft #1 >
  188.         { 'nameresult nameresult ", " * t * := }
  189.         { numnames #2 >
  190.         { 'nameresult nameresult "," * := }
  191.         'skip$
  192.           if$
  193.           t "others" =
  194.         { 'nameresult nameresult " {\it et al.}" * := }
  195.         { 'nameresult nameresult " and " * t * := }
  196.           if$
  197.         }
  198.       if$
  199.     }
  200.     { 'nameresult nameresult t * := }
  201.       if$
  202.       'nameptr nameptr #1 + :=
  203.       'namesleft namesleft #1 - :=
  204.     }
  205.   while$
  206.   nameresult
  207. }
  208.  
  209. FUNCTION {format.authors}
  210. { author missing$
  211.     { "" }
  212.     { author format.names }
  213.   if$
  214. }
  215.  
  216. FUNCTION {format.editors}
  217. { editor missing$
  218.     { "" }
  219.     { editor num.names$ #1 >
  220.     { editor format.names ", eds." * }
  221.     { editor format.names ", ed." * }
  222.       if$
  223.     }
  224.   if$
  225. }
  226.  
  227.  
  228. FUNCTION {format.title}
  229.  
  230. { title missing$
  231.     { "" }
  232.     { "``" title "ul" change.case$ * ",''" * }
  233.   if$
  234.  
  235. }
  236.  
  237.  
  238. FUNCTION {entry.string.max} { #100 }
  239.  
  240. FUNCTION {global.string.max} { #300 }
  241.  
  242.  
  243. STRINGS {pageresult}
  244.  
  245. FUNCTION {n.dashify}
  246. { 't swap$ :=
  247.   'pageresult "" :=
  248.     { t "" = not }
  249.     { t #1 #1 substring$ "-" =
  250.     { t #1 #2 substring$ "--" = not
  251.         { 'pageresult pageresult "--" * :=
  252.           't t #2 global.string.max substring$ :=
  253.         }
  254.         {   { t #1 #1 substring$ "-" = }
  255.         { 'pageresult pageresult "-" * :=
  256.           't t #2 global.string.max substring$ :=
  257.         }
  258.           while$
  259.         }
  260.       if$
  261.     }
  262.     { 'pageresult pageresult t #1 #1 substring$ * :=
  263.       't t #2 global.string.max substring$ :=
  264.     }
  265.       if$
  266.     }
  267.   while$
  268.   pageresult
  269. }
  270.  
  271.  
  272. FUNCTION {format.date}
  273. { year missing$
  274.     { month missing$
  275.     { "" }
  276.     { "Warning: there's a month but no year in " cite$ * top$
  277.       month
  278.     }
  279.       if$
  280.     }
  281.     { month missing$
  282.     { year }
  283.     { month " " * year * }
  284.       if$
  285.     }
  286.   if$
  287. }
  288.  
  289.  
  290. FUNCTION {format.btitle}
  291. { title field.or.null
  292.   italicize
  293. }
  294.  
  295.  
  296. FUNCTION {format.bvolume}
  297. { volume missing$
  298.     { series missing$
  299.     { "" }
  300.     { series italicize }
  301.       if$
  302.     }
  303.     { "Vol.~" volume *
  304.       series missing$
  305.     'skip$
  306.     { " of " * series italicize * }
  307.       if$
  308.     }
  309.   if$
  310. }
  311.  
  312.  
  313. FUNCTION {format.edition}
  314. { edition missing$
  315.     { "" }
  316.     { edition "ll" change.case$ " ed." * }
  317.   if$
  318. }
  319.  
  320.  
  321. INTEGERS {multiresult}
  322.  
  323. FUNCTION {multi.page.check}
  324. { 't swap$ :=
  325.   'multiresult #0 :=
  326.     { multiresult not
  327.       t "" = not
  328.       and
  329.     }
  330.     { t #1 #1 substring$ "-" =
  331.       t #1 #1 substring$ "," =
  332.       or
  333.     { 'multiresult #1 := }
  334.     { 't t #2 global.string.max substring$ := }
  335.       if$
  336.     }
  337.   while$
  338.   multiresult
  339. }
  340.  
  341.  
  342. FUNCTION {format.pages}
  343. { pages missing$
  344.     { "" }
  345.     { pages multi.page.check
  346.     { "pp.~" pages n.dashify * }
  347.     { "p.~" pages n.dashify * }
  348.       if$
  349.     }
  350.   if$
  351. }
  352.  
  353.  
  354. FUNCTION {format.volume}
  355. { volume missing$
  356.     { "" }
  357.     { "vol.~" volume * }
  358.   if$
  359. }
  360.  
  361. FUNCTION {format.number}
  362. { number missing$
  363.     { "" }
  364.     { "no.~" number * }
  365.   if$
  366. }
  367.  
  368. FUNCTION {format.chapter.pages}
  369. { chapter missing$
  370.     'format.pages
  371.     { "ch.~" chapter *
  372.       pages missing$
  373.         'skip$
  374.         { ", " * format.pages * }
  375.       if$
  376.     }
  377.   if$
  378. }
  379.  
  380. FUNCTION {format.in.ed.booktitle}
  381. { booktitle missing$
  382.     { "" }
  383.     { 't format.editors :=
  384.       t "" =
  385.     { "in " booktitle italicize * }
  386.     { "in " booktitle italicize * ", (" * t * ")" * }
  387.       if$
  388.     }
  389.   if$
  390. }
  391.  
  392.  
  393. FUNCTION {format.tr.number}
  394. { type missing$
  395.     { "Tech. Rep." }
  396.     { type }
  397.   if$
  398.   number missing$
  399.     'skip$
  400.     { "~" * number * }
  401.   if$
  402. }
  403.  
  404. FUNCTION {format.addr.pub}
  405. { publisher missing$
  406.     { "" }
  407.     { address missing$
  408.         { "" }
  409.         { address ": " * }
  410.       if$
  411.       publisher *
  412.     }
  413.   if$
  414. }
  415.  
  416. FUNCTION {format.paddress}
  417. { address missing$
  418.     { "" }
  419.     { "(" address * ")" * }
  420.   if$
  421. }
  422.  
  423. FUNCTION {article}
  424. { output.bibitem
  425.   "author" format.authors output.check
  426.   "title" format.title output.check
  427.   blank.sep
  428.   "journal" journal field.or.null italicize output.check
  429.   format.volume output
  430.   month missing$
  431.     { format.number output }
  432.     'skip$
  433.   if$
  434.   "pages" format.pages output.check
  435.   "year" format.date output.check
  436.   new.block
  437.   note field.or.null output
  438.   fin.entry
  439. }
  440.  
  441. FUNCTION {book}
  442. { output.bibitem
  443.   author missing$
  444.     { "author and editor" format.editors output.check }
  445.     { "author" format.authors output.check }
  446.   if$
  447.   "title" format.btitle output.check
  448.   new.block
  449.   format.bvolume output
  450.   "publisher" format.addr.pub output.check
  451.   format.edition output
  452.   "year" format.date output.check
  453.   new.block
  454.   note field.or.null output
  455.   fin.entry
  456. }
  457.  
  458. FUNCTION {booklet}
  459. { output.bibitem
  460.   format.authors output
  461.   "title" format.btitle output.check
  462.   new.block
  463.   howpublished field.or.null output
  464.   address field.or.null output
  465.   format.date output
  466.   new.block
  467.   note field.or.null output
  468.   fin.entry
  469. }
  470.  
  471. FUNCTION {inbook}
  472. { output.bibitem
  473.   author missing$
  474.     { "author and editor" format.editors output.check }
  475.     { "author" format.authors output.check }
  476.   if$
  477.   "title" format.btitle output.check
  478.   "chapter and pages" format.chapter.pages output.check
  479.   new.block
  480.   format.bvolume output
  481.   "publisher" format.addr.pub output.check
  482.   format.edition output
  483.   "year" format.date output.check
  484.   new.block
  485.   note field.or.null output
  486.   fin.entry
  487. }
  488.  
  489. FUNCTION {incollection}
  490. { output.bibitem
  491.   "authors" format.authors output.check
  492.   "title" format.title output.check
  493.   blank.sep
  494.   "booktitle" format.in.ed.booktitle output.check
  495.   format.chapter.pages output
  496.   "publisher" format.addr.pub output.check
  497.   "year" format.date output.check
  498.   new.block
  499.   note field.or.null output
  500.   fin.entry
  501. }
  502.  
  503. FUNCTION {inproceedings}
  504. { output.bibitem
  505.   "author" format.authors output.check
  506.   "title" format.title output.check
  507.   blank.sep
  508.   "booktitle" format.in.ed.booktitle output.check
  509.   format.paddress output
  510.   format.pages output
  511.   organization field.or.null output
  512.   publisher field.or.null output
  513.   "year" format.date output.check
  514.   new.block
  515.   note field.or.null output
  516.   fin.entry
  517. }
  518.  
  519. FUNCTION {conference} { inproceedings }
  520.  
  521. FUNCTION {manual}
  522. { output.bibitem
  523.   format.authors output
  524.   "title" format.btitle output.check
  525.   new.block
  526.   organization field.or.null output
  527.   address field.or.null output
  528.   format.edition output
  529.   format.date output
  530.   new.block
  531.   note field.or.null output
  532.   fin.entry
  533. }
  534.  
  535. FUNCTION {mastersthesis}
  536. { output.bibitem
  537.   "author" format.authors output.check
  538.   "title" format.btitle output.check
  539.   new.block
  540.   "Master's thesis" output
  541.   "school" school field.or.null output.check
  542.   address field.or.null output
  543.   "year" format.date output.check
  544.   new.block
  545.   note field.or.null output
  546.   fin.entry
  547. }
  548.  
  549.  
  550. FUNCTION {misc}
  551. { output.bibitem
  552.   format.authors output
  553.   format.title output
  554.   blank.sep
  555.   howpublished field.or.null output
  556.   format.date output
  557.   new.block
  558.   note field.or.null output
  559.   fin.entry
  560. }
  561.  
  562. FUNCTION {phdthesis}
  563. { output.bibitem
  564.   "author" format.authors output.check
  565.   "title" format.btitle output.check
  566.   new.block
  567.   "PhD thesis" output
  568.   "school" school field.or.null output.check
  569.   address field.or.null output
  570.   "year" format.date output.check
  571.   new.block
  572.   note field.or.null output
  573.   fin.entry
  574. }
  575.  
  576. FUNCTION {proceedings}
  577. { output.bibitem
  578.   editor missing$
  579.     { organization missing$
  580.     'skip$
  581.     { organization field.or.null output }
  582.       if$
  583.     }
  584.     { format.editors output }
  585.   if$
  586.   "title" format.btitle output.check
  587.   format.paddress output
  588.   editor missing$
  589.     'skip$
  590.     { organization field.or.null output }
  591.   if$
  592.   publisher field.or.null output
  593.   "year" format.date output.check
  594.   new.block
  595.   note field.or.null output
  596.   fin.entry
  597. }
  598.  
  599. FUNCTION {techreport}
  600. { output.bibitem
  601.   "author" format.authors output.check
  602.   "title" format.title output.check
  603.   blank.sep
  604.   format.tr.number output
  605.   "institution" institution field.or.null output.check
  606.   address field.or.null output
  607.   "year" format.date output.check
  608.   new.block
  609.   note field.or.null output
  610.   fin.entry
  611. }
  612.  
  613. FUNCTION {unpublished}
  614. { output.bibitem
  615.   "author" format.authors output.check
  616.   "title" format.title output.check
  617.   blank.sep
  618.   format.date output
  619.   new.block
  620.   "note" note field.or.null output.check
  621.   fin.entry
  622. }
  623.  
  624. FUNCTION {default.type} { book }
  625.  
  626. MACRO {jan} {"Jan."}
  627.  
  628. MACRO {feb} {"Feb."}
  629.  
  630. MACRO {mar} {"March"}
  631.  
  632. MACRO {apr} {"Apr."}
  633.  
  634. MACRO {may} {"May"}
  635.  
  636. MACRO {jun} {"June"}
  637.  
  638. MACRO {jul} {"July"}
  639.  
  640. MACRO {aug} {"Aug."}
  641.  
  642. MACRO {sep} {"Sep."}
  643.  
  644. MACRO {oct} {"Oct."}
  645.  
  646. MACRO {nov} {"Nov."}
  647.  
  648. MACRO {dec} {"Dec."}
  649.  
  650. MACRO {acmcs} {"ACM Computing Surveys"}
  651.  
  652. MACRO {acta} {"Acta Informatica"}
  653.  
  654. MACRO {cacm} {"Communications ACM"}
  655.  
  656. MACRO {ibmjrd} {"IBM J. Research and Development"}
  657.  
  658. MACRO {ibmsj} {"IBM Systems J."}
  659.  
  660. MACRO {ieeese} {"IEEE Trans. Software Engineering"}
  661.  
  662. MACRO {ieeetc} {"IEEE Trans. Computers"}
  663.  
  664. MACRO {ieeetcad}
  665.  {"IEEE Trans. Computer-Aided Design"}
  666.  
  667. MACRO {ipl} {"Information Processing Letters"}
  668.  
  669. MACRO {jacm} {"J. ACM"}
  670.  
  671. MACRO {jcss} {"J. Computer and System Sciences"}
  672.  
  673. MACRO {scp} {"Science of Computer Programming"}
  674.  
  675. MACRO {sicomp} {"SIAM J. Computing"}
  676.  
  677. MACRO {tocs} {"ACM Trans. Computer Systems"}
  678.  
  679. MACRO {tods} {"ACM Trans. Database Systems"}
  680.  
  681. MACRO {tog} {"ACM Trans. Graphics"}
  682.  
  683. MACRO {toms} {"ACM Trans. Mathematical Software"}
  684.  
  685. MACRO {toois} {"ACM Trans. Office Information Systems"}
  686.  
  687. MACRO {toplas} {"ACM Trans. Programming Languages and Systems"}
  688.  
  689. MACRO {tcs} {"Theoretical Computer Science"}
  690.  
  691. READ
  692.  
  693. STRINGS {longest.label}
  694.  
  695. INTEGERS { number.label longest.label.width }
  696.  
  697. FUNCTION {initialize.longest.label}
  698. { 'longest.label "" :=
  699.   'number.label #1  :=
  700.   'longest.label.width #0 :=
  701. }
  702.  
  703. FUNCTION {longest.label.pass}
  704. { 'label number.label int.to.str$ :=
  705.   'number.label number.label #1 + :=
  706.   label width$ longest.label.width >
  707.     { 'longest.label label :=
  708.       'longest.label.width label width$ :=
  709.     }
  710.     'skip$
  711.   if$
  712. }
  713.  
  714. EXECUTE {initialize.longest.label}
  715.  
  716. ITERATE {longest.label.pass}
  717.  
  718. FUNCTION {preamble}
  719. { "\begin{thebibliography}{"  longest.label  * "}" * write$
  720.   newline$
  721. }
  722.  
  723. EXECUTE {preamble}
  724.  
  725. EXECUTE {init.state.consts}
  726.  
  727. ITERATE {call.type$}
  728.  
  729. FUNCTION {finish.up} { newline$ "\end{thebibliography}" write$ newline$ }
  730.  
  731. EXECUTE {finish.up}
  732.